class Stundet():
    def __init__(self,name,gender):
        self.name = name
        self.__gender = gender  ##设置私有属性

    #定义装饰器
    @property
    def gender(self):
        return self.__gender

    #设置修改参数
    @gender.setter
    def gender(self,gender):
        self.__gender = gender

xs1=Stundet('dxl','男')

#修改gender属性
xs1.gender="女"
print(xs1.gender) ##打印
print(xs1.gender,xs1.name)























